package com.lau.videoeffect.utils

import android.content.Context
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.Reader

class GLUtil {

    companion object {

        fun readFromRaw(context: Context, rawId: Int): String {
            val sb = StringBuilder()
            try {
                val inputStream = context.resources.openRawResource(rawId)
                val reader = BufferedReader(InputStreamReader(inputStream) as Reader?)
                var line = reader.readLine()

                while (line != null) {
                    sb.appendln(line)
                    line = reader.readLine()
                }
            } catch (e: Exception) {
                e.printStackTrace()
            }

            return sb.toString()
        }

    }


}